package com.example.xksys.service.imp;
import com.example.xksys.mapper.AdminOperationMapper;
import com.example.xksys.service.AdminOperatorService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class AdminOperatorServiceImpl implements AdminOperatorService {
    @Resource
    private AdminOperationMapper adminOperationMapper;
    @Override
    public Integer Login(Map<String, String> map) {
        //验证是否为本人操作

        return adminOperationMapper.AdminLogin(map);
    }

    @Override
    public Integer InsertC(Map<String, String> map) {
        return adminOperationMapper.InsertCourse(map);
    }

    @Override
    public Integer deleteCById(Map<String, String> mp) {
        System.err.println(mp.get("cKey"));
        adminOperationMapper.deleteXkByCKey(mp);
        return adminOperationMapper.deleteCourseByKey(mp);
    }

    @Override
    public List<Map<String, Object>> selectAll(Map<String,Object>mp) {
        return  adminOperationMapper.selectCourseByTrim(mp);
    }

    @Override
    public Integer update(Map<String, String> map) {
        return adminOperationMapper.updateCourseByKey(map);
    }
}
